package com.wifipositioner.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.wifipositioner.R;

public class WifipositionerActivity extends Activity {
    
	public static Context context;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        context = getApplicationContext();
        registerHandlers();
    }
    public void registerHandlers(){
    	Button btn_viewSS = (Button) findViewById(R.id.splash_btn_viewSS);
    	btn_viewSS.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent newIntent = new Intent(WifipositionerActivity.this, 
											  ViewSignalStrenghtActivity.class);
	            startActivity(newIntent);
	            
			}
		});
    	Button btn_start = (Button) findViewById(R.id.splash_btn_start);
    	btn_start.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent newIntent = new Intent(WifipositionerActivity.this, 
						FileChooserActivity.class);
				startActivity(newIntent);

			}
		});
    	
    }
	@Override
	public boolean onMenuItemSelected(int featureId, MenuItem item) {
		switch (item.getItemId()) {
	       case 0: {
	    	   Intent newIntent = new Intent(WifipositionerActivity.this, 
						SettingsActivity.class);
	    	   startActivity(newIntent);
	    	   
	    	   break;
	       }	   
	
 	}
		return super.onMenuItemSelected(featureId, item);
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		menu.add(Menu.NONE,0,0,"Settings");
		return super.onCreateOptionsMenu(menu);
	}
}